<?php if(!IS_AJAX){?>
<script>

function confirmaff(){
	if(!confirm('您确认要这样操作吗？')){return false;}
	var order_id = new Array();
	var attr = new Array();
	var product_id = new Array();
	$("input[name='order_id[]']").each(function(index, element) {
         if($(this).prop('checked') == true){
			order_id.push($(this).val()); 
			attr.push($("input[name='attr[]']").eq(index).val());
			product_id.push($("input[name='product_id[]']").eq(index).val());
		 }
    });
	data = {'order_id':order_id,'attr':attr,'product_id':product_id};
	if(order_id.length > 0){
	$.post('{:U('confirm')}', data, function(ret){
		$('#afflistform').submit();
	}, 'json');
	}else{
		alert('请选择一个或多个记录后点击确认！');
	}
	
}
</script>	

      <form action="{:U('afflist')}" style="padding-bottom:8px;" id="afflistform" method="get" class="fr form-inline">      
      
      
      
      
      
      
      
      
      时间：<input class="form-control" type="text" onclick="WdatePicker();" name="stime" value="{$stime}" /> 至 <input class="form-control" type="text" onclick="WdatePicker();" name="etime" value="{$etime}" />
      
        
        <input type="hidden" name="pagesize" value="{$pagesize}" />
      
      
      
        <input type="hidden" name="pagesize" value="{$pagesize}" />
        <input type="text" name="keywords" placeholder="输入订单号搜索" class="form-control" value="" />
        <button type="submit" class="btn btn-default">搜索</button>
        
        
        <a href="##" class="btn btn-success" onClick="confirmaff();">确认收益</a>
      </form>
      
      
      </div>
    
    <div class="table_">
      <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
        <thead>
          <tr>
            <td align="center">ID</td>
          
            <td align="center">收益金额</td>
            <td align="center">订单号</td>
            <td align="center">收益时间</td>
            <td align="center">收益状态</td>
            <td align="center">订单状态</td>
            <td align="center">操作</td>
          </tr>
        </thead>
        <tbody id="afflist">
        
        <?php }?>
        <?php if(IS_AJAX){ ?>
        <volist name="list" id="vo">
          <tr class="data_list">
          <td align="center">
          
          <!-- 完成显示分成按钮 -->
     
          
          <eq name="vo['status']" value="0">
          <input type="checkbox" class="sall" name="order_id[]" value="{$vo.order_id}"><input name="attr[]" type="hidden" value="{$vo.attr}"><input type="hidden" name="product_id[]" value="{$vo.product_id}">
          
          
          </eq>
          

          
          <!-- 完成显示分成按钮 -->
          
          </td>
            <td align="center">{$vo.changenum}</td>
            
            <td align="center">
            <notempty name="vo['img_url']"><a class="showcurimg" href="javascript:void(0);">
            <img src="{:getThumbPath($vo['img_url'])}" style="width:200px; position:absolute; margin-top:0px; display:none;" class="img" /></a></notempty>
            
            {$vo.order_sn}</td>
            <td align="center">{:date('Y-m-d H:i:s', $vo['dateline'])}
              </td>
            
             <td align="center"><eq name="vo['status']" value="0">待确认</eq>
             <eq name="vo['status']" value="2"><span style="color:#f00;">已经退货</span></eq>
             <eq name="vo['status']" value="1"><span style="color:#3B841D; font-weight:bold;">已确认</span></eq>
            
              </td>
            <td align="center"><eq name="vo['ostatus']" value="2">可以收益</eq></td>
           
            <td align="center"><a href="##" onClick="art.dialog.open('{:U('orderafflist', array('order_id' => $vo['order_id'], 'attr' => $vo['attr'], 'product_id' => $vo['product_id']))}', {width: 800, height: 500,lock:true,title:'订单收益<?php echo $vo['order_sn'];?>'});">查看该订单收益明细</a></td>
          </tr>
        </volist>
        <?php }?>
        <?php if(!IS_AJAX){ ?>
</tbody>
      </table>
      <div id="afflistpages"></div>
      <script>
	      $('#afflist').ajaxlist({});
	  </script> 
      <?php }?>